<template>
    <div class="house-item">
        <div class="house-inner">
            <div class="image">
                <img :src="item.image.url" alt="">
            </div>
            <div class="info">
                <div class="location">
                    <van-icon name="location" color="#808080" />
                    {{ item.location }}
                </div>
                <div class="name">{{ item.houseName }}</div>
                <div class="summary">{{ item.summaryText }}</div>
                <div class="price">
                    <div class="cheap">￥{{ item.finalPrice }}</div>
                    <div class="exp">{{ item.productPrice }}</div>
                    <div class="sale">立减￥{{ item.productPrice - item.finalPrice }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
defineProps({
    item: {
        type: Object,
        default: () => ({})
    }
})
</script>

<style lang="less" scoped>
.house-item {
    width: 50%;

    .house-inner {
        margin: 5px;

        .image {
            img {
                width: 100%;
                border-radius: 6px;
            }
        }

        .info {
            padding: 15px 8px 0;

            .location {
                color: #000;
            }

            .name {
                color: #333;
                margin: 5px 0;

                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
            }

            .summary {
                color: #666;
                font-size: 12px;
            }

            .price {
                display: flex;
                justify-content: left;
                align-items: center;

                margin: 10px 0;

                .cheap {
                    color: var(--primary-color);
                }

                .exp {
                    color: #999;
                    text-decoration: line-through;
                    font-size: 12px;
                    margin: 0 5px;
                }

                .sale {
                    font-size: 12px;
                    color: #fff;
                    border-radius: 10px;
                    padding: 0 3px;
                    background-image: linear-gradient(270deg, #f66, #ff9f9f);
                }
            }
        }
    }
}
</style>